import config from 'config';
import httpFetch from 'share/httpFetch';
import errorMessage from 'share/errorMessage';

export default {
  getListData(url) {
    return new Promise((resolve, reject) => {
      const res = httpFetch.get(`${config.baseUrl}/api/driver/local${url}`).then((res) => {
        resolve(res);
      }).catch((err) => {
        errorMessage(err.response);
        reject(err.response);
      });
    });
  }
};
